package com.gongjian.database.dservice;

import com.github.pagehelper.PageHelper;
import com.gongjian.database.entity.User;
import com.gongjian.utile.Crud;
import com.gongjian.utile.utile.Hump;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author donting
 * @Description
 * @create 2019-03-30 11:26
 */
@Service
public class DClasseService {
    @Autowired
    SqlSession sqlSession;

    public String findAllClasse(int Page, int PageSize) {
        PageHelper.startPage(Page, PageSize);

        //  根据分页插件 自行查询出当前页内容
        List<Map<String, Object>> lists = sqlSession.selectList("DfindAllClasse");

        return new Crud<Map<String, Object>>().selectMany(Hump.formatHumpNameForList(lists));

    }
}
